package bpm.service.document;
import bpm.domain.document.Document;
import bpm.domain.document.DocumentEntry;
/**
 * 
 * @author ZhaoWangLong Sep 21, 2011
 *
 */
public class TransDocument {
	public static Document tarnsDoc(Document document){
		for (DocumentEntry entry:document.getEntries()){
			String key=entry.getFieldKey();
			String value=entry.getValue();
			if("title".equals(key)){
				document.setTitle(value);
			}
			if("bgtType".equals(key)){
				document.setBgtType(value);
			}
			if("bgtCode".equals(key)){
				document.setBgtCode(value);
			}
			if("officialCode".equals(key)){
				document.setOfficialCode(value);
			}
			if("draftDept".equals(key))
				document.setDraftDept(value);
			if("fromCode".equals(key))
				document.setFromCode(value);
			if("fromOrg".equals(key))
				document.setFromOrg(value);
			if("keyWord".equals(key))
				document.setKeyword(value);
			if("deadLine".equals(key))
				document.setDeadline(value);
		}
		
		return document;
	}
}
